package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.query.OperationV2SubConfigQuery;
import com.novax.ex.activity.open.model.request.OperationV2SubConfigRequest;
import com.novax.ex.activity.open.model.response.OperationV2SubConfigResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.validation.Valid;

/**
 * @Description 后台-活动落地页配置V2
 * @Author ChenXi
 * @Date 2023/04/18/10:48
 */
@Tag(name = "后台-活动落地页 子活动配置V2", description = "后台-活动落地页 子活动配置V2")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "OperationV2SubConfigApi", contextId = "OperationV2SubConfigApi")
public interface OperationV2SubConfigApi {

    @Operation(summary = "查询")
    @GetMapping("/v3/private/operation-v2/sub-config")
    ReturnResult<PageUtil<OperationV2SubConfigResponse>> page(@ParameterObject OperationV2SubConfigQuery query);

    @Operation(summary = "新增")
    @PostMapping("/v3/private/operation-v2/sub-config/add")
    ReturnResult<?> add(@RequestHeader("language") String language,
                        @Valid @RequestBody OperationV2SubConfigRequest operationV2SubConfigRequest,
                        BindingResult bindingResult);

    @Operation(summary = "修改")
    @PostMapping("/v3/private/operation-v2/sub-config/modify/{operationSubId}")
    ReturnResult<?> modify(@RequestHeader("language") String language,
                           @PathVariable Long operationSubId,
                           @Valid @RequestBody OperationV2SubConfigRequest operationV2SubConfigRequest,
                           BindingResult bindingResult);

    @Operation(summary = "删除")
    @PostMapping("/v3/private/operation-v2/sub-config/delete/{operationSubId}")
    ReturnResult<?> remove(@RequestHeader("language") String language,
                           @PathVariable Long operationSubId);

    @Operation(summary = "批量删除")
    @PostMapping("/v3/private/operation-v2/sub-config/batch-delete")
    ReturnResult<?> batchRemove(@RequestHeader("language") String language,
                                @RequestParam String ids);

}
